package cn.stylefeng.guns.modular.hx.storage.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CommonVariables{
    UNCLAIMED(0, "待领取"),
    RECEIVED(1, "已领取"),
    COMPLETED(2, "已完成");
    private final int value;
    private final String desc;

    public static CommonVariables of(Integer value) {
        if (value == null) {
            return null;
        }
        for (CommonVariables commonStatus : values()) {
            if (commonStatus.getValue() == value) {
                return commonStatus;
            }
        }
        return null;
    }

    public static String desc(Integer value) {
        CommonVariables status = of(value);
        return status.getDesc();
    }
}
